﻿using System.Text.RegularExpressions;

namespace 物流管理系统
{
    internal class ReMatch
    {
        Regex specialre = new Regex(@"['\s#\-;=\+]");
        Regex idre = new Regex(@"^[a-zA-Z0-9]{5,15}$");
        Regex carid = new Regex(@"^[\u4e00-\u9fa5][A-Z][A-Z\d]{5}");
        Regex namere = new Regex(@"^([\u4e00-\u9fa5]{2,10})|([A-Za-z]{2,20})$");
        Regex intnumre = new Regex(@"^[1-9]\d*$");
        Regex decnumre = new Regex(@"^\d+\.\d{1,2}$");
        Regex phonere = new Regex(@"(^\+\d{12,14}$)|(^1\d{10}$)");
        Regex adressre = new Regex(@"^[\u4e00-\u9fa5a-zA-Z0-9]{2,}$");
        Regex chcharre = new Regex(@"^[\u4e00-\u9fa5]+$");
        Regex ldre = new Regex(@"[\u4e00-\u9fa5a-zA-Z]+");
        Regex bankacre = new Regex(@"^[1-9](\d{14}|\d{18})$");
        Regex pwdre = new Regex(@"[\da-zA-Z@*_\.]{4,16}");
        public bool specialmatch(string s) => specialre.IsMatch(s);
        public bool idmatch(string s) => idre.IsMatch(s);
        public bool caridmatch(string s) => carid.IsMatch(s);
        public bool namematch(string s) => namere.IsMatch(s);
        public bool intmatch(string s) => intnumre.IsMatch(s);
        public bool decmatch(string s) => decnumre.IsMatch(s);
        public bool phonematch(string s) => phonere.IsMatch(s);
        public bool adressmatch(string s) => adressre.IsMatch(s);
        public bool chcharmatch(string s) => chcharre.IsMatch(s);
        public bool ldmatch(string s) => ldre.IsMatch(s);
        public bool bankmatch(string s) => bankacre.IsMatch(s);
        public bool pwdmatch(string s) => pwdre.IsMatch(s);

    }
}
